//****************************************************************/
//Creation History
// Company: GZ office
// NAME:    CostCenter.java
// TITLE:   Cost Center Column Accessibility Maintenance
// BY:      Oscar Bai
// DATE:    03/03/2003
//******************************************************************/
//Modification History
//******************************************************************/
// CR 1347  Miranda Lin  11-Aug-2004
// ADD: added division id
//******************************************************************/

package  admin.system.costcenter;

import com.ffpc.sql.*;

public class CostCenter
  extends DataObject
  implements CostCenterBean{


  private String cost_center_id=null;
  private String cost_center_name=null;
  private String cost_center_des=null;
  private String crt_user=null;
  private String crt_date=null;
  private String upd_user=null;
  private String upd_date=null;
/* CR 1347 */
  private String division_id=null;
/* CR 1347 */
  private Column ColCost_Center_id = null;
  private Column ColCost_Center_name = null;
  private Column ColCost_Center_des = null;
  private Column ColCrt_user = null;
  private Column ColCrt_date = null;
  private Column ColUpd_user = null;
  private Column ColUpd_date = null;
/* CR 1347 */
  private Column ColDivision_id = null;
/* CR 1347 */
  //Constructor

  public CostCenter(){
    ColCost_Center_id=new Column(0,"cost_center_id",Column.Types.string,null,10,false);
    ColCost_Center_name=new Column(0,"cost_center_name",Column.Types.string,null,50,false);
    ColCost_Center_des=new Column(0,"cost_center_des",Column.Types.string,null,100,false);
    ColCrt_user=new Column(0,"crt_user",Column.Types.string,null,10,true);
    ColCrt_date=new Column(0,"crt_date",Column.Types.time,null,10,true);
    ColUpd_user=new Column(0,"upd_user",Column.Types.string,null,10,true);
    ColUpd_date=new Column(0,"upd_date",Column.Types.time,null,10,true);
/* CR 1347 */
    ColDivision_id=new Column(0,"division_id",Column.Types.string,null,10,false);
/* CR 1347 */
  }

  @Override
public void setCost_Center_id(String cost_center_id){
    this.cost_center_id=this.setAttribute(ColCost_Center_id,cost_center_id);
  }

  @Override
public String getCost_Center_id(){
    return this.cost_center_id==null?"":this.cost_center_id;
  }

  @Override
public void setCost_Center_name(String cost_center_name){
    this.cost_center_name=this.setAttribute(ColCost_Center_name,cost_center_name);
  }

  @Override
public String getCost_Center_name(){
    return this.cost_center_name==null?"":this.cost_center_name;
  }

  @Override
public void setCost_Center_des(String cost_center_des){
    this.cost_center_des=this.setAttribute(ColCost_Center_des,cost_center_des);
  }

  @Override
public String getCost_Center_des(){
    return this.cost_center_des==null?"":this.cost_center_des;
  }

  @Override
public void setCrt_user(String crt_user){
    this.crt_user=this.setAttribute(ColCrt_user,crt_user);
  }

  @Override
public String getCrt_user(){
    return this.crt_user==null?"":this.crt_user;
  }

  @Override
public void setCrt_date(String crt_date){
    this.crt_date=this.setAttribute(ColCrt_date,crt_date);
  }

  @Override
public String getCrt_date(){
    return this.crt_date==null?"":this.crt_date;
  }

  @Override
public void setUpd_user(String upd_user){
    this.upd_user=this.setAttribute(ColUpd_user,upd_user);
  }

  @Override
public String getUpd_user(){
    return this.upd_user==null?"":this.upd_user;
  }

  @Override
public void setUpd_date(String upd_date){
    this.upd_date=this.setAttribute(ColUpd_date,upd_date);
  }

  @Override
public String getUpd_date(){
    return this.upd_date==null?"":this.upd_date;
  }
/* CR 1347 */
  @Override
public void setDivision_id(String division_id){
    this.division_id=this.setAttribute(ColDivision_id,division_id);
  }

  @Override
public String getDivision_id(){
    return this.division_id==null?"":this.division_id;
  }
/* CR 1347 */
    // belongs to row interface
  @Override
public Column[] createColumns()
  {
    Column[] cols = new Column[8];
    cols[0] = ColCost_Center_id.clone(null);
    cols[1] = ColCost_Center_name.clone(null);
    cols[2] = ColCost_Center_des.clone(null);
    cols[3] = ColCrt_user.clone(null);
    cols[4] = ColCrt_date.clone(null);
    cols[5] = ColUpd_user.clone(null);
    cols[6] = ColUpd_date.clone(null);
/* CR 1347 */
    cols[7] = ColDivision_id.clone(null);
/* CR 1347 */
    return cols;
  }

    // super's abstract methods

  @Override
public String getTableName()
  {
    return "jis.jis_s_cost_center";
  }

  @Override
protected String[] getKeyColumnNames()
  {
    String[] list = {"cost_center_id"};
    return list;
  }

  @Override
protected String[] getUpdatableColumnNames()
  {
/* CR 1347 */
    String[] list = {"cost_center_id","cost_center_name","cost_center_des","crt_user","crt_date","upd_user","upd_date","division_id"};
/* CR 1347 */
    return list;
  }

  @Override
protected void retrieveColumnValues()
  {
    this.cost_center_id = this.retrieveColumnValue("cost_center_id");
    this.cost_center_name = this.retrieveColumnValue("cost_center_name");
    this.cost_center_des = this.retrieveColumnValue("cost_center_des");
    this.crt_user = this.retrieveColumnValue("crt_user");
    this.crt_date = this.retrieveColumnValue("crt_date");
    this.upd_user = this.retrieveColumnValue("upd_user");
    this.upd_date = this.retrieveColumnValue("upd_date");
/* CR 1347 */
    this.division_id = this.retrieveColumnValue("division_id");
/* CR 1347 */
  }


}

